#include <controls/table/cxitable.h>
#include <private/table/cxitable_p.h>
#include <qsortfilterproxymodel.h>
#include <qtablewidget.h>

#include <utility>

CxiTable::CxiTable(QWidget* parent) :
	 QWidget(parent)
	,d_ptr(new CxiTablePrivate(this))
{
}

CxiTable::~CxiTable()
{
}
void CxiTable::setModel(CxiTableModel* model)
{
	Q_D(CxiTable);
	if (!model) return;
	d->setModel(model);
}

void CxiTable::setColumnConfigs(const QList<cxitable::GridColumnConfig>& configs)
{
	Q_D(CxiTable);
	d->setColumnConfigs(configs);
}

void CxiTable::addGroup(const int column, const QString& groupTitle)
{
	Q_D(CxiTable);
	d->addGroup(column, groupTitle);
}

void CxiTable::addGroups(const QList<cxitable::GroupConfig>& groupConfigs)
{
	Q_D(CxiTable);
	d->addGroups(groupConfigs);
}

void CxiTable::removeGroups(const QList<int>& columns)
{
	Q_D(CxiTable);
	d->removeGroups(columns);
}

void CxiTable::setItemDelegate(QAbstractItemDelegate* delegate)
{
}
void CxiTable::setItemDelegateForColumn(int column, QAbstractItemDelegate* delegate)
{
}
void CxiTable::setItemDelegateForRow(int row, QAbstractItemDelegate* delegate)
{
}
void CxiTable::setItemDelegateForCell(int row, int column, QAbstractItemDelegate* delegate)
{
}
void CxiTable::expandAll()
{
	Q_D(CxiTable);
	d->m_view->expandAll();
}
void CxiTable::collapseAll()
{
	Q_D(CxiTable);
	d->m_view->collapseAll();
}
void CxiTable::rebuildGroup()
{
}
void CxiTable::onFilter(int column, const QString& condition)
{
	Q_D(CxiTable);
	d->onFilter(column, condition);
}
void CxiTable::clearFilter()
{
	Q_D(CxiTable);
	d->clearFilter();
}